﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace FolderCalendar
{
    [SerializableAttribute()]
    public class UsersCollection
    {
        public List<User> List { get; set; }
        /// <summary>
        /// Check's if user exists
        /// </summary>
        /// <param name="userName">User name</param>
        /// <returns></returns>
        public bool Exists(string userName) 
        {
            foreach (User user in List) 
            {
                if(userName == user.Name)
                {
                    return true;
                }
            }
            return false;
        }
    }
}
